#include "LightsSystem.h"

#include "SubState.h"

State * LightsSystem::redState     = new RedState;
State * LightsSystem::yellowState  = new YellowState;
State * LightsSystem::greenState   = new GreenState;

LightsSystem::LightsSystem(){
   _currentState = LightsSystem::redState;
   //_currentState->start();
}
LightsSystem::~LightsSystem(){
    //_currentState->stop();
}

void LightsSystem::changeState(State * state){
    if(_currentState != state)
        _currentState = state;
}

void LightsSystem::start(){
    _currentState->start();
}
void LightsSystem::stop(){
    _currentState->stop();
}
/*
void pause(){
    //_timer->stop();
}
void resume(){
    //_timer->start();
}*/
void LightsSystem::onTimeout(){
    _currentState->onTimeout(this);
}
